$rcn()

Syntax

$rcn(ELEMENT as element/string/array of ELEMENTs, CLASSNAME as string)

Arguments

ELEMENTDOM ElementstringDOM Element Array

The element(s) with the class to remove. Can be a single DOM element, an element ID specified as a string, or an array of DOM Element objects. If specifying the ID as a string, the ID corresponds to the value for the id HTML attribute for the element you wish to assign a style.

CLASSNAMEstring

The class to remove from the element(s).

Description

The $rcn() function removes the class name from the passed-in element(s). This will only remove the specified class name. You might want to use this to remove some temporary styling to an element, such as a focus, or error style. This function is typically used after the $acn() function has been used to add a class name to an element.

Example

/*Assume that you previously added the 'inputError' class name to an element to indicate that a validation error had occurred. Now, assume that the user has
corrected the error and you want to remove the 'inputError' class name from the element. */
$rcn('firstname','inputError');
 
/*Remove a class name from multiple elements.*/
$rcn(['firstname','lastname','address','city','state','zip'],'inputError');
Use {dialog.object}.getPointer() to get the DOM element for a control.

See Also